﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FlyBird
{
    class GameTime
    {
        //开始
        private long beginTime;
        //结束
        private long endTime;
        //时间差
        private long differ;

        public GameTime() { }
        
        public void begin()
        {
            beginTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
        }
        //获取时间差
        public long getDiffer()
        {
            endTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds;
            return differ = (endTime - beginTime);
        }
    }
}
